"""
  模块描述：短地址详情接受推送服务端
  @author 8526
  @date 2022-05-15 14:09:25
  版权所有 Copyright www.dahantc.com
"""

import json

from flask import Flask, request

import shorturldetailentity as entity

app = Flask(__name__)


@app.route('/shortUrlReceive', methods=['POST'])
def hiddenNumCallReceive():
    status = 'success'
    try:
        shorturlDetail = request.form.get('shorturl')
        detailRes = entity.shortUrlDetailResponseDecoder(json.loads(shorturlDetail))
        print('短地址详情推送：', detailRes)
    except Exception as e:
        print('数据解析异常 %s' % e)
        status = 'Failure'
    return {'status': status}


if __name__ == '__main__':
    app.run(debug=False, port=8080)
